import request from '@/router/axios'

export function fetchRegexInfoList(query) {
  return request({
    url: '/eims/regexInfo/page',
    method: 'get',
    params: query
  })
}

export function addRegexInfoObj(obj) {
  return request({
    url: '/eims/regexInfo',
    method: 'post',
    data: obj
  })
}

export function getRegexInfoObj(id) {
  return request({
    url: '/eims/regexInfo/' + id,
    method: 'get'
  })
}

export function delRegexInfoObj(id) {
  return request({
    url: '/eims/regexInfo/' + id,
    method: 'delete'
  })
}

export function putRegexInfoObj(obj) {
  return request({
    url: '/eims/regexInfo',
    method: 'put',
    data: obj
  })
}

// 查询正则表达式列表
export function getRegexList(){
  return request({
    url: '/eims/regexInfo/getInfoList',
    method: 'get'
  })
}

// 根据数据库名称获取所有表名
export function getListName(tableBaseName) {
  return request({
    url: '/gen/dsconf/getListByTableBase/' + tableBaseName,
    method: 'get'
  })
}

// 根据数据库名称和表名称获取表字段
export function getListField(tableBaseName,tableName){
  return request({
    url: '/gen/dsconf/getListByTableBaseAndTableName/' + tableBaseName + '/' + tableName,
    method: 'get'
  })
}

// 
export function getRegexMessage(obj){
  return request({
    url: '/eims/regexInfo/getInfoByParam',
    method: 'post',
    data: obj
  })
}
